/**
 * Licensed to the Apache Software Foundation （ASF） under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * （the "License"）； you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * <p>
 * https://www.q3z3.com
 * QQ : 939313737
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.platform.modules.sys.service.impl;

import com.platform.common.web.service.impl.BaseServiceImpl;
import com.platform.common.web.utils.Pager;
import com.platform.modules.sys.dao.SysDictDao;
import com.platform.modules.sys.domain.SysDict;
import com.platform.modules.sys.service.SysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
 * <p>
 * 系统字典 服务层实现
 * </p>
 */
@Service("sysDictService")
public class SysDictServiceImpl extends BaseServiceImpl<SysDict> implements SysDictService {

    @Resource
    private SysDictDao sysDictDao;

    @Autowired
    public void setBaseDao() {
        super.setBaseDao(sysDictDao);
    }

    @Override
    public List<SysDict> queryList(SysDict t) {
        List<SysDict> dataList = sysDictDao.queryList(t);
        return dataList;
    }

    @Override
    public Pager<SysDict> queryPager(SysDict t) {
        List<SysDict> dataList = queryList(t);
        return formatPager(dataList);
    }

    @Override
    public List<SysDict> queryByType(String dictType) {
        SysDict sysDict = new SysDict();
        sysDict.setDictType(dictType);
        List<SysDict> list = queryList(sysDict);
        return list;
    }

    @Override
    public SysDict queryTypeInfo(String dictType) {
        SysDict sysDict = new SysDict();
        sysDict.setDictType(dictType);
        return this.queryOne(sysDict);
    }
}
